import Vue from "vue";
import VueRoute from "vue-router";
// 一级路由
import Home from "../views/Home";
import Login from "../views/Login";

// 二级路由
import New from "../views/Home/components/New";
import Game from "../views/Home/components/Game";
import Movie from "../views/Home/components/Movie";



Vue.use(VueRoute);

export default new VueRoute({
  routes: [
    {
      path: "/home",
      component: Home,
      // 配置默认子路由
      redirect: "/home/new",
      // 二级路由
      children: [
        {
          path: "new",
          component: New
        },
        {
          path: "game",
          component: Game
        },
        {
          path: "movie",
          component: Movie
        }
      ]
    },
    {
      path: "/login",
      component: Login
    },
    // 默认路由
    {
      path: "/",
      // 重定向的配置
      redirect: "/home"
    }
  ]
});